/*******************************************************************************
 * Size: 28 px
 * Bpp: 2
 * Opts: --font DSEG7Classic-BoldItalic.ttf -r 0x20-0x3F --size 28 --format lvgl --bpp 2 -o c_files//seg7_28.c
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

#ifndef SEG7_28
#define SEG7_28 1
#endif

#if SEG7_28

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+0020 " " */

    /* U+0021 "!" */

    /* U+002D "-" */
    0xa, 0xbf, 0x90, 0x3a, 0xff, 0x40, 0x83, 0xfe,
    0x8c, 0x3f, 0xcc,

    /* U+002E "." */
    0x14, 0x54, 0xa0, 0xa0, 0x20,

    /* U+0030 "0" */
    0xe, 0xaf, 0xfe, 0x8, 0x7d, 0x2f, 0xff, 0x6,
    0xe, 0xf0, 0x7f, 0xf0, 0x1f, 0x4, 0x94, 0xf,
    0xf3, 0xc1, 0xf5, 0xff, 0xf4, 0x1f, 0xfc, 0x7c,
    0x3d, 0x87, 0xff, 0x59, 0x2, 0x1f, 0xfc, 0xc4,
    0x8, 0x7f, 0xf5, 0xb0, 0xff, 0xe7, 0xe1, 0xff,
    0xc7, 0x90, 0xff, 0x40, 0x42, 0xa2, 0x1f, 0xf3,
    0x40, 0x9b, 0xf, 0xfe, 0xd, 0x3, 0x98, 0x3f,
    0xec, 0x3f, 0x21, 0xfe, 0x83, 0xd8, 0x7f, 0xf5,
    0x90, 0x21, 0xe4, 0x3f, 0xf8, 0xa8, 0x7f, 0xf1,
    0x30, 0xff, 0xe7, 0xe1, 0xff, 0xd6, 0x43, 0xea,
    0xfe, 0x43, 0xf3, 0x45, 0xfe, 0xa0, 0x7a, 0xe0,
    0xff, 0xaa, 0xc, 0xe1, 0xff, 0xc2, 0x42,

    /* U+0031 "1" */
    0xf, 0xf9, 0xc3, 0x30, 0x66, 0xe, 0xc3, 0xff,
    0x82, 0x81, 0xf, 0xfe, 0x46, 0x1f, 0xfc, 0x58,
    0x8, 0x4c, 0x87, 0x48, 0x6c, 0x3a, 0xf, 0xe4,
    0x24, 0x3f, 0xf8, 0x98, 0x7f, 0xf2, 0x10, 0x90,
    0xf4, 0x1f, 0x78, 0x20,

    /* U+0032 "2" */
    0xe, 0xaf, 0xfe, 0x8, 0x7d, 0x2f, 0xff, 0x6,
    0xf, 0x41, 0xff, 0xc0, 0x7c, 0x1e, 0xc3, 0xfc,
    0xf0, 0x7e, 0xff, 0xfa, 0xf, 0xfe, 0x3e, 0x1f,
    0xfd, 0xd4, 0x8, 0x7f, 0xfc, 0xb0, 0xff, 0xf2,
    0x5f, 0xfd, 0x40, 0x21, 0xda, 0x1f, 0xcf, 0x40,
    0x9e, 0x81, 0xff, 0x4a, 0xe, 0x79, 0x7f, 0xb0,
    0xfe, 0x55, 0x7f, 0x7, 0xd8, 0x7f, 0xf8, 0x10,
    0xff, 0xe2, 0xa1, 0xff, 0xe0, 0xc3, 0xff, 0xb8,
    0x95, 0xfc, 0x87, 0xe7, 0x97, 0xfa, 0xf, 0xae,
    0xf, 0xfb, 0xf, 0x38, 0x7f, 0xf0, 0x50, 0xc0,

    /* U+0033 "3" */
    0xd, 0x5f, 0xfc, 0x10, 0xf4, 0xbf, 0xfc, 0x18,
    0x3a, 0xf, 0xfe, 0x3, 0xe0, 0xec, 0x3f, 0xcf,
    0x7, 0xdf, 0xff, 0x41, 0xff, 0xc6, 0xc3, 0xff,
    0xb6, 0x81, 0xf, 0xff, 0x7e, 0x1f, 0xfe, 0x1b,
    0xff, 0xa8, 0x4, 0x36, 0x87, 0xf3, 0xd0, 0x3a,
    0xf, 0xfb, 0xa0, 0x73, 0x2f, 0xf5, 0x3, 0xf3,
    0x5f, 0xd8, 0x7f, 0xf6, 0xd0, 0x21, 0xff, 0xdb,
    0xc3, 0xff, 0xde, 0x87, 0x35, 0xfc, 0x87, 0xe6,
    0x5f, 0xea, 0x7, 0x98, 0x3f, 0xea, 0x83, 0x61,
    0xff, 0xc2, 0x42,

    /* U+0034 "4" */
    0x2, 0x1f, 0xfc, 0x34, 0x2a, 0x7, 0xff, 0x7,
    0x80, 0x8c, 0x1f, 0xf6, 0x1f, 0x21, 0xfe, 0x83,
    0xff, 0x9b, 0x87, 0xff, 0x11, 0xf, 0xfe, 0x22,
    0x1f, 0x90, 0xff, 0xe2, 0x21, 0xff, 0xc4, 0xc3,
    0xff, 0x9b, 0x87, 0xff, 0x22, 0xbf, 0x90, 0x90,
    0xd4, 0x5f, 0xea, 0x7, 0x7a, 0xf, 0xfb, 0xa0,
    0x76, 0x1f, 0xe4, 0xa0, 0x7b, 0xff, 0xe4, 0x3f,
    0xf8, 0xd8, 0x7f, 0xf2, 0x90, 0xff, 0xe2, 0x21,
    0xff, 0xde, 0xc3, 0xff, 0xde, 0x87, 0xff, 0x12,
    0xf, 0xfe, 0x3b, 0x21, 0xff, 0xc6, 0x60, 0x80,

    /* U+0035 "5" */
    0xd, 0x5f, 0xfc, 0x10, 0xe9, 0x7f, 0xf8, 0x30,
    0x5e, 0xf, 0xfe, 0x3, 0x1, 0x28, 0x1f, 0xe6,
    0xf, 0x5f, 0xfe, 0x83, 0xff, 0x97, 0x87, 0xff,
    0xb1, 0x2, 0x1f, 0xfe, 0xcc, 0x3f, 0xf8, 0xb7,
    0xff, 0xa0, 0xea, 0x90, 0xfe, 0x60, 0xca, 0x83,
    0xfe, 0xf8, 0x33, 0x2f, 0xf5, 0x3, 0xe6, 0xbf,
    0xb0, 0xff, 0xec, 0xa0, 0x43, 0xff, 0xb3, 0x87,
    0xff, 0xb1, 0xc, 0xd7, 0xf2, 0x1f, 0x32, 0xff,
    0x50, 0x39, 0x83, 0xfe, 0xa8, 0x2c, 0x3f, 0xf8,
    0x48, 0x0,

    /* U+0036 "6" */
    0xe, 0xaf, 0xfe, 0x8, 0x7a, 0x5f, 0xfe, 0xc,
    0x1b, 0xc1, 0xff, 0xc0, 0x60, 0x92, 0x81, 0xfe,
    0x60, 0xfa, 0xff, 0xf4, 0x1f, 0xfc, 0xdc, 0x3f,
    0xfd, 0xe8, 0x10, 0xff, 0xf7, 0xe1, 0xff, 0xc6,
    0xbf, 0xfd, 0x7, 0xaa, 0x43, 0xf9, 0x83, 0x37,
    0x7, 0xfd, 0xf0, 0x67, 0x97, 0xfa, 0x81, 0xf2,
    0xab, 0xfb, 0xe, 0xc3, 0xff, 0xaa, 0x81, 0xe,
    0x43, 0xff, 0x88, 0x87, 0xff, 0x13, 0xf, 0xfe,
    0x6e, 0x1f, 0xfd, 0x54, 0x32, 0x57, 0xf2, 0x1f,
    0x3c, 0xbf, 0xd4, 0xe, 0xb8, 0x3f, 0xea, 0x82,
    0x70, 0xff, 0xe1, 0x20,

    /* U+0037 "7" */
    0xd, 0x5f, 0xfc, 0x10, 0xf4, 0xbf, 0xfc, 0x18,
    0x37, 0x83, 0xff, 0x80, 0xf8, 0x9, 0x40, 0xff,
    0x3c, 0x1e, 0xbf, 0xfe, 0x83, 0xff, 0x8d, 0x87,
    0x61, 0xff, 0xd5, 0x40, 0x87, 0xff, 0x29, 0x2,
    0x1f, 0xfd, 0x5c, 0x3b, 0xf, 0xfe, 0xd4, 0x87,
    0xfa, 0x2, 0xb, 0x43, 0xfe, 0x68, 0x12, 0x1f,
    0xfc, 0x2a, 0x7, 0xff, 0x17, 0xf, 0xfe, 0x34,
    0x1f, 0xfc, 0xa4, 0x3f, 0xf8, 0x88, 0x7f, 0xf7,
    0xb0, 0xff, 0xf7, 0xa1, 0xff, 0xc4, 0x43, 0xff,
    0x8f, 0x7, 0xff, 0x23, 0xc1, 0x0,

    /* U+0038 "8" */
    0xe, 0xaf, 0xfe, 0x8, 0x7d, 0x2f, 0xff, 0x6,
    0xe, 0xf0, 0x7f, 0xf0, 0x1f, 0x4, 0x94, 0xf,
    0xf3, 0xc1, 0xf5, 0xff, 0xf4, 0x1f, 0xfc, 0x7c,
    0x3d, 0x87, 0xff, 0x59, 0x2, 0x1f, 0xfc, 0xc4,
    0x8, 0x7f, 0xf5, 0xb0, 0xff, 0xe7, 0xe1, 0xff,
    0xc7, 0xbf, 0xfd, 0x40, 0x21, 0x54, 0x87, 0xf3,
    0xd0, 0x26, 0xe0, 0xff, 0xba, 0x7, 0x3c, 0xbf,
    0xd4, 0xf, 0xca, 0xaf, 0xec, 0x3d, 0x87, 0xff,
    0x59, 0x2, 0x1e, 0x43, 0xff, 0x8a, 0x87, 0xff,
    0x13, 0xf, 0xfe, 0x7e, 0x1f, 0xfd, 0x64, 0x39,
    0x2b, 0xf9, 0xf, 0xcf, 0x2f, 0xf5, 0x3, 0xd7,
    0x7, 0xfd, 0x50, 0x67, 0xf, 0xfe, 0x12, 0x10,

    /* U+0039 "9" */
    0xd, 0x5f, 0xfc, 0x10, 0xf4, 0xbf, 0xfc, 0x18,
    0x37, 0x83, 0xff, 0x80, 0xf8, 0x9, 0x40, 0xff,
    0x3c, 0x1e, 0xbf, 0xfe, 0x83, 0xff, 0x8d, 0x87,
    0x61, 0xff, 0xd5, 0x40, 0x87, 0xff, 0x29, 0x2,
    0x1f, 0xfd, 0x5c, 0x3f, 0xf9, 0xb8, 0x7f, 0xf1,
    0xaf, 0xff, 0x50, 0x8, 0x2a, 0x43, 0xf9, 0xe8,
    0x12, 0xa0, 0xff, 0xba, 0x7, 0x32, 0xff, 0x50,
    0x3f, 0x35, 0xfd, 0x87, 0xff, 0x6d, 0x2, 0x1f,
    0xfd, 0xbc, 0x3f, 0xfd, 0xe8, 0x73, 0x5f, 0xc8,
    0x7e, 0x65, 0xfe, 0xa0, 0x79, 0x83, 0xfe, 0xa8,
    0x36, 0x1f, 0xfc, 0x24, 0x20,

    /* U+003A ":" */
    0x5, 0xa0, 0x51, 0x1, 0xf, 0x76, 0x19, 0xf,
    0xfe, 0xe2, 0x1b, 0xb0, 0x21, 0xc8, 0x20, 0x0
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 90, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 0, .adv_w = 366, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 0, .adv_w = 366, .box_w = 14, .box_h = 4, .ofs_x = 4, .ofs_y = 12},
    {.bitmap_index = 11, .adv_w = 0, .box_w = 4, .box_h = 4, .ofs_x = -3, .ofs_y = 0},
    {.bitmap_index = 16, .adv_w = 366, .box_w = 21, .box_h = 29, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 111, .adv_w = 366, .box_w = 7, .box_h = 27, .ofs_x = 15, .ofs_y = 1},
    {.bitmap_index = 147, .adv_w = 366, .box_w = 21, .box_h = 29, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 227, .adv_w = 366, .box_w = 20, .box_h = 29, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 302, .adv_w = 366, .box_w = 20, .box_h = 27, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 382, .adv_w = 366, .box_w = 19, .box_h = 29, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 456, .adv_w = 366, .box_w = 20, .box_h = 29, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 540, .adv_w = 366, .box_w = 20, .box_h = 28, .ofs_x = 2, .ofs_y = 1},
    {.bitmap_index = 618, .adv_w = 366, .box_w = 21, .box_h = 29, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 714, .adv_w = 366, .box_w = 20, .box_h = 29, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 799, .adv_w = 90, .box_w = 6, .box_h = 15, .ofs_x = 0, .ofs_y = 6}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_0[] = {
    0x0, 0x1, 0xd, 0xe
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 32, .range_length = 15, .glyph_id_start = 1,
        .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 4, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    },
    {
        .range_start = 48, .range_length = 11, .glyph_id_start = 5,
        .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
    }
};



/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LVGL_VERSION_MAJOR >= 8
/*Store all the custom data of the font*/
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 2,
    .bpp = 2,
    .kern_classes = 0,
    .bitmap_format = 1,
};


/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t seg7_28 = {
#else
lv_font_t seg7_28 = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 29,          /*The maximum line height required by the font*/
    .base_line = 0,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0)
    .underline_position = -3,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};



#endif /*#if SEG7_28*/

